import request from '@/utils/requestExam'

// 查询证书列表
export function listCertInfo(query) {
  return request({
    url: '/api/uf/boostor/exam/certinfo/ExamCertInfoRest/searchByPage/v1',
    method: 'post',
    data: query
  })
}

// 查询本年已失效和即将失效证书列表
export function selectCertByYear(query) {
  return request({
    url: '/api/uf/boostor/exam/certinfo/ExamCertInfoRest/selectCertByYear/v1',
    method: 'post',
    data: query
  })
}

// 查询历史证书列表
export function listHistoryCertInfo(query) {
  return request({
    url: '/exam/cert/history',
    method: 'get',
    params: query
  })
}

// 根据证书ID查询证书详细信息
export function selectCertInfoByCertId(certId) {
  return request({
    url: '/exam/cert/' + certId,
    method: 'get'
  })
}

// 延期证书
export function postponeCert(data) {
  return request({
    url: '/api/uf/boostor/exam/certinfo/ExamCertInfoRest/postpone/v1',
    method: 'post',
    data: data
  })
}

// 吊销证书
export function revokeCert(data) {
  return request({
    url: '/api/uf/boostor/exam/certinfo/ExamCertInfoRest/revoke/v1',
    method: 'post',
    data: data
  })
}

// 系统自动吊销证书
export function autoRevokeCert(data) {
  return request({
    url: '/api/uf/boostor/exam/certinfo/ExamCertInfoRest/autoRevoke/v1',
    method: 'post',
    data: data
  })
}

// 下载证书导入模板
export function importTemplate() {
  return request({
    url: '/api/uf/boostor/exam/certinfo/ExamCertInfoRest/importTemplate/v1',
    method: 'get'
  })
}

// 导出证书
export function exportCert(data) {
  return request({
    url: '/api/uf/boostor/exam/certinfo/ExamCertInfoRest/export/v1',
    method: 'post',
    data: data
  })
}

//删除证书（正式上线不提供该功能）
export function deleteCert(certIds){
  return request({
    url: "/api/uf/boostor/exam/certinfo/ExamCertInfoRest/remove/" + certIds,
    method: "delete"
  })
}
